#include<bits/stdc++.h>

using namespace std;
const int maxn = 8000;

/**
 * 大整数打印函数
 * @param a
 */
void print_bigint(int a[]) {
    int i = maxn - 1;
    while (i > 0 && a[i] == 0)i--;
    for (; i >= 0; i--) {
        cout << a[i];
    }
    cout << endl;
}

/**
 * 大整数a乘以普通整数k 相当于a*=k
 * @param a
 * @param k
 */
void mul(int a[], int k) {
    for (int i = 0; i < maxn; i++)a[i] *= k;
    int carry = 0;
    for (int i = 0; i < maxn; i++) {
        a[i] += carry;
        carry = a[i] / 10;
        a[i] %= 10;
    }
}

int main() {

    int c[maxn] = {1};
    for (int i = 2; i <= 1977; i++) {
        mul(c, i);
    }
    print_bigint(c);
    return 0;
}

